﻿@model IEnumerable<SportsStore.Models.Product>

<div class="panel panel-primary">
    <a href="/prep/signin" class="btn btn-sm btn-primary">Sign in</a>
    <a href="/prep/signout" class="btn btn-sm btn-primary">Sign out</a>
    User:@(HttpContext.Current.User.Identity.Name)
</div>

<div class="panel panel-primary">
    <div class="panel-heading">Products</div>
    <table class="table table-stripped">
        <tr><th>id</th><th>name</th><th>category</th><th>price</th></tr>
        @foreach (var p in Model)
        {
            <tr>
                <td>@p.Id</td>
                <td>@p.Name</td>
                <td>@p.Category</td>
                <td>@p.Price</td>
            </tr>
        }
    </table>
</div>

@using (Html.BeginForm("SaveProduct", "Prep"))
{
    <input type="hidden" name="Name" value="zippy running shows" />
    <input type="hidden" name="Category" value="running" />
    <input type="hidden" name="Description" value="set a new record time" />
    <input type="hidden" name="Price" value="159.99" />

    <button class="btn btn-primary" type="submit">Create</button>
    <a href="/prep/deleteproduct/2" class="btn btn-primary">Delete</a>
}